import getImageUrla from './utils.js';

//props传递参数，可指定默认值
function Avatar({ person, size = 50 }) {
  return (
    <img
      className="avatar"
      src={getImageUrla(person)}
      alt={person.name}
      width={size}
      height={size}
    />
  );
}

function Card({ children }) {
  return (
    <div className="card"> 
      {children}
    </div>
  );
}

export default function Profile() {
  return (
    <Card>

      {/* <h1>props</h1> */}

      <Avatar
        size={100}
        person={{
          name: 'Katsuko Saruhashi',
          imageId: 'YfeOqp2'
        }}
      />
    </Card>
  );
}



